package com.slz3.business.module.orderManagement.ordRefund.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.orderManagement.ordRefund.domain.OrdRefund;
import com.slz3.business.module.orderManagement.ordRefund.domain.OrdRefundCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class OrdRefundResAtomic {

    static Mono<ServerResponse> add_$OrdRefundUpdateLock(ServerRequest req, OrdRefund ordRefund) {
        return OrdRefundResSafeValid.add(req, ordRefund) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdRefundResExecutor.add(req, ordRefund);
    }

    public static Mono<ServerResponse> delete_$OrdRefundUpdateLock(ServerRequest req, OrdRefundCondition ordRefundCondition) {
        return OrdRefundResSafeValid.delete(req, ordRefundCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdRefundResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$OrdRefundUpdateLock(ServerRequest req, OrdRefund ordRefund) {
        return OrdRefundResSafeValid.modify(req, ordRefund) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdRefundResExecutor.modify(req, ordRefund);
    }

    static Mono<ServerResponse> info_$OrdRefundUpdateLock(ServerRequest req) {
        return OrdRefundResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdRefundResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$OrdRefundUpdateLock(ServerRequest req, OrdRefundCondition ordRefundCondition) {
        return OrdRefundResSafeValid.auditSubmit(req, ordRefundCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdRefundResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$OrdRefundUpdateLock(ServerRequest req, OrdRefundCondition ordRefundCondition) {
        return OrdRefundResSafeValid.audit(req, ordRefundCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdRefundResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$OrdRefundUpdateLock(ServerRequest req, OrdRefundCondition ordRefundCondition) {
        return OrdRefundResSafeValid.auditReject(req, ordRefundCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdRefundResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$OrdRefundUpdateLock(ServerRequest req, OrdRefundCondition ordRefundCondition) {
        return OrdRefundResSafeValid.usingEnable(req, ordRefundCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdRefundResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$OrdRefundUpdateLock(ServerRequest req, OrdRefundCondition ordRefundCondition) {
        return OrdRefundResSafeValid.usingDisable(req, ordRefundCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdRefundResExecutor.usingDisable(req);
    }
}
